package com.example.zy.car.view;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.example.zy.car.R;
import com.example.zy.car.base.BaseActivityWithTitleBar;


public class EvaluateTypeActivity extends BaseActivityWithTitleBar {
    private TextView mEdit_data,mEdit_number;
    private ListView mListView;
    private String[] str={"证件照片","车辆等级内容","车辆正前照","左前45度","左侧正面","左后45度",
            "正后方","后备胎","右后45度","右侧正面","右前45度","其他"};
    

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_evaluate_type);
        this.setLeftTitleTv("返回", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
                overridePendingTransition(R.anim.extre_in,R.anim.extre_out);
            }
        });
        this.setCenterTitleTv("评估类别");
        this.setRightTitleTv("完成评估", new View.OnClickListener() {
            //完成评估的时间 监听，提交所有的信息
            @Override
            public void onClick(View v) {
                Toast.makeText(mActivity, "这里还没有添加监听", Toast.LENGTH_SHORT).show();
            }
        });
        initView();
        initData();
        ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_expandable_list_item_1,str);
        mListView.setAdapter(adapter);
        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                if (position==0){
                    Intent intent=new Intent(EvaluateTypeActivity.this,EvaluateSelectActivity.class);
                    intent.putExtra("str",str[position]);
                    startActivity(intent);
                    overridePendingTransition(R.anim.enter_in,R.anim.enter_out);
                }
            }
        });
        
    }
    private void initData() {
        Intent intent=this.getIntent();
        Bundle bundle=intent.getExtras();
        bundle=intent.getBundleExtra("lala");
        mEdit_data.setText("日期："+bundle.getString("data"));
        mEdit_number.setText("评估单号："+bundle.getString("number"));
    }

    private void initView() {
        mEdit_data= (TextView) findViewById(R.id.edit_evaluate_type_data);
        mEdit_number= (TextView) findViewById(R.id.edit_evaluate_type_number);
        mListView= (ListView) findViewById(R.id.evaluate_type_listview);
    }
}
